﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TeacherHelp.DAL
{
    public class TestInfoService
    {
        public string GetTestInfoSQL()
        {
            string sql = $@"
            SELECT A.[Id]
                 ,A.[TestId]
                 ,A.[Answer]
                 ,A.[SelectResult]
                 ,A.[ExercisesId]
                 ,A.[IsNan]
				 ,B.[Content]
				 ,B.[Aoption]
				 ,B.[Boption]
				 ,B.[Coption]
				 ,B.[Doption]
            FROM[TeacherHelpDB].[dbo].[TestInfo] A
			INNER JOIN [Exercises] B ON A.ExercisesId = B.Id";
            return sql;
        }

        public string GetWhereTestIdSQL(string id)
        {
            string sql = $" WHERE TestId = " + id;
            return sql;
        }

        public string GetOrderByDesc()
        {
            string sql = $" order by StartTime desc ";
            return sql;
        }

        public string GetWhereStuNameSQL(string stuName)
        {
            string sql = $" and c.[Name] like '%{stuName}%' ";
            return sql;
        }
    }
}
